package com.my.demoactivemq.demo2;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * 订阅者02的监听器
 * @author zsy
 * @email 308964086@qq.com
 * @date 2019-07-22
 */
public class Listerner02 implements MessageListener {
    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("订阅者02接收到消息："+((TextMessage)message).getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
